package com.hmkj.core.model.quote;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 实时简要行情数据
 *
 * @author Vector
 * @create 2017-11-14 14:57
 */
@Data
public class SimpleRealData {
    /**
     * 最新价
     */
    @ApiModelProperty(value = "最新价")
    private BigDecimal np;
    /**
     * 涨跌值
     */
    @ApiModelProperty(value = "涨跌值")
    private BigDecimal rp;
    /**
     * 涨跌幅
     */
    @ApiModelProperty(value = "涨跌幅")
    private BigDecimal rf;
    /**
     * 时间戳
     */
    @ApiModelProperty(value = "时间戳")
    private long dt;

    public static SimpleRealData buildData(RealTimeData realTimeData) {
        SimpleRealData simple = new SimpleRealData();
        simple.setNp(realTimeData.getNp());
        simple.setDt(realTimeData.getDt());
        simple.setRp(realTimeData.getRp());
        simple.setRf(realTimeData.getRf());
        return simple;
    }
}
